//Crimes Against Morality
//Purpose: This file runs the do file to general the Wild Bootstrap P-values //This version: October 3, 2020; Jennifer Seager

#delimit;

log using "$dout/bootstrap.log", append;

*1.1 Bootstrapping for Column 1 (STI) of Table II Panel A, B and Table I.IV Panel A, B;
do "$dir/Bootstrap/Crimes-Against-Morality_Bootstrap_1-1.do";

*1.2 Bootstrapping for Column 1 (STI) of Table I.IV Panel C1, C2;
do "$dir/Bootstrap/Crimes-Against-Morality_Bootstrap_1-2.do";

*2.1 Bootstrapping Columns 2-7 of Table II, Panel A and Table I.IV Panel A;
*	 Bootstrapping Columns 1-4,6 of Table III, Panel A and Table I.V Panel A;	 
foreach out in hlthacc cndom_index condeasy havecondom condomprice easyask   
			   wrksite_index cl7day tr7day hr7day earn7day {;

disp "**********`out'**********";
global var = "`out'";

do "$db/Crimes-Against-Morality_Bootstrap_2-1.do";

};
*;

*2.2 Bootstrapping Columns 2-7 of Table II, Panel B and Table I.IV Panel B;
*	 Bootstrapping Columns 1-4,5 of Table III, Panel B and Table I.V Panel B;	
foreach out in hlthacc cndom_indexp condeasy havecondom condomprice easyask   
			   wrksite_indexp cl7day tr7day hr7day earn7day {;

disp "**********`out'**********";
global var = "`out'";

do "$db/Crimes-Against-Morality_Bootstrap_2-2.do";

};
*;

*2.3 Bootstrapping Columns 2-7 of Table I.IV Panel C1, C2;
*	 Bootstrapping Columns 1-4,6 of Table I.V Panel D1, D2; 
foreach out in hlthacc cndom_indexp condeasy havecondom condomprice easyask   
			   wrksite_indexp cl7day tr7day hr7day earn7day {;
global var = "`out'";
disp "**********`out'**********";

do "$db/Crimes-Against-Morality_Bootstrap_2-3.do";

};
*;

*2.4 Bootstrapping Columns 1-3,6 of Table III, Panel C;
*	 Bootstrapping Columns 1-3,6 of Table I.V, Panel C;

foreach out in wrksitec_index fsws2 sextimes transprice spend7day {;

disp "*******************`out'*********************";

global var = "`out'";

do "$db/Crimes-Against-Morality_Bootstrap_2-4.do";

};

*2.5 Bootstrapping Column 8 of Table II Panel A, B and Table I.IV Panel A, B, C1, C2;
*	 Bootstrapping Column 5 of Table III Panel A, B and Table I.V Panel A, B, D1, D2;
foreach out in noco1 transprice {;
global var = "`out'";
disp "**********`out'**********";
do "$db/Crimes-Against-Morality_Bootstrap_2-5.do";

};

*2.6 Bootstrapping Column 9 of Table II Panel A, Table I.IV Panel A;
*	 Bootstrapping Column 5 of Table III Panel C, Table I.V Panel C;
foreach out in noco1 transprice {;
global var = "`out'";
do "$db/Crimes-Against-Morality_Bootstrap_2-6.do";

};
*;

*3.1 Bootstrapping Columns 1-6, Table IV, Panel A, B;
foreach out in vag regular clean handsome outsider rich {;
global var = "`out'";
disp "**********`out'**********";
do "$db/Crimes-Against-Morality_Bootstrap_3-1.do";

};
*;

*3.2 Bootstrapping Columns 1-4, Table IV, Panel C;
foreach out in vag regular clean attractive {;
global var = "`out'";

do "$db/Crimes-Against-Morality_Bootstrap_3-2.do";

};
*;

*3.3 Bootstrapping Columns 7-12, Panel A, B;
foreach out in unmarried edyrs age disc_factor risktol children {;
disp "**********`out'**********";
global var = "`out'";

do "$db/Crimes-Against-Morality_Bootstrap_3-3.do";

};
*;

*3.4 Bootstrapping Columns 7-11, Panel C;
foreach out in unmarried edyrs age disc_factor risktol {;

disp "**********`out'**********";
global var = "`out'";

do "$db/Crimes-Against-Morality_Bootstrap_3-4.do";

};

*4.1 Bootstrapping Table V, Panel A1-3;
 foreach out in earntotal totalhours1 lessade vunhappy {;
 
global var = "`out'";
disp "**********`out'**********";

do "$db/Crimes-Against-Morality_Bootstrap_4-1.do" ;
 };
 
*4.2 Bootstrapping Table V, Panel B1-2;
 foreach out in aff aff_do aff_schlcost aff_wrk {;
 
global var = "`out'";
disp "**********`out'**********";

 do "$db/Crimes-Against-Morality_Bootstrap_4-2.do" ;
 
 };
 *;


*5.1 Bootstrapping Table I.IX, Column 1;

foreach out in attrit_ansamp{;
foreach coeff in i_married i_edyrs i_age i_children i_sw_locyrs i_disc_factor i_risktol_nodl{;
				 
	if "`coeff'" == "i_married" {;
	
	global controls = "i_edyrs i_age i_children i_sw_locyrs i_disc_factor 
					 i_risktol_nodl i_nodlr married edyrs age children sw_locyrs 
					 disc_factor risktol_nodl nodlr closing";	
	};
	else if "`coeff'" == "i_edyrs" {;
	
	global controls = "i_married i_age i_children i_sw_locyrs i_disc_factor 
					  i_risktol_nodl i_nodlr married edyrs age children sw_locyrs 
					  disc_factor risktol_nodl nodlr closing";
	};
	else if "`coeff'" == "i_age" {;
	
	global controls = "i_married i_edyrs i_children i_sw_locyrs i_disc_factor 
					  i_risktol_nodl i_nodlr married edyrs age children sw_locyrs 
					  disc_factor risktol_nodl nodlr closing";
	};
	else if "`coeff'" == "i_children" {;
	
	global controls = "i_married i_edyrs i_age i_sw_locyrs i_disc_factor 
					  i_risktol_nodl i_nodlr married edyrs age children sw_locyrs 
					  disc_factor risktol_nodl nodlr closing";
	};
	else if "`coeff'" == "i_sw_locyrs" {;
	
	global controls = "i_married i_edyrs i_age i_children i_disc_factor 
					  i_risktol_nodl i_nodlr married edyrs age children sw_locyrs 
					  disc_factor risktol_nodl nodlr closing";
	};
	else if "`coeff'" == "i_disc_factor" {;
	
	global controls = "i_married i_edyrs i_age i_children i_sw_locyrs 
					  i_risktol_nodl i_nodlr married edyrs age children sw_locyrs 
					  disc_factor risktol_nodl nodlr closing";
	};
	else if "`coeff'" == "i_risktol_nodl" {;
	
	global controls = "i_married i_edyrs i_age i_children i_sw_locyrs i_disc_factor 
					  i_nodlr married edyrs age children sw_locyrs 
					  disc_factor risktol_nodl nodlr closing";
	};

disp "**********`out'**********";
global var = "`out'";
global coeff2 = "`coeff'";
do "$db/Crimes-Against-Morality_Bootstrap_5-1.do";


};
*;
};

*5.2 Bootstrapping Table I.IX, Column 2;

foreach out in attrit_ansamp {;
foreach coeff in i_hlthacc i_condeasy i_havecondom i_condomprice i_cl7day
				 i_tr7day i_hr7day i_earn7day {;
				 
	if "`coeff'" == "i_hlthacc" {;
	
	global controls = "i_condeasy i_havecondom i_condomprice i_cl7day
					   i_tr7day i_hr7day i_earn7day 
					   hlthacc condeasy havecondom condomprice cl7day
					   tr7day hr7day earn7day  closing";	
	};
	else if "`coeff'" == "i_condeasy" {;
	
	global controls = "i_hlthacc i_havecondom i_condomprice i_cl7day
					   i_tr7day i_hr7day i_earn7day 
					   hlthacc condeasy havecondom condomprice cl7day
					   tr7day hr7day earn7day  closing";
	};
	else if "`coeff'" == "i_havecondom" {;
	
	global controls = "i_hlthacc i_condeasy i_condomprice i_cl7day
					   i_tr7day i_hr7day i_earn7day 
					   hlthacc condeasy havecondom condomprice cl7day
					   tr7day hr7day earn7day  closing";
	};
	else if "`coeff'" == "i_condomprice" {;
	
	global controls = "i_hlthacc i_condeasy i_havecondom i_cl7day
					   i_tr7day i_hr7day i_earn7day 
					   hlthacc condeasy havecondom condomprice cl7day
					   tr7day hr7day earn7day  closing";
	};
	else if "`coeff'" == "i_cl7day" {;
	
	global controls = "i_hlthacc i_condeasy i_havecondom i_condomprice 
					   i_tr7day i_hr7day i_earn7day 
					   hlthacc condeasy havecondom condomprice cl7day
					   tr7day hr7day earn7day  closing";
	};
	else if "`coeff'" == "i_tr7day" {;
	
	global controls = "i_hlthacc i_condeasy i_havecondom i_condomprice i_cl7day
					   i_hr7day i_earn7day 
					   hlthacc condeasy havecondom condomprice cl7day
					   tr7day hr7day earn7day  closing";
	};
	else if "`coeff'" == "i_hr7day" {;
	
	global controls = "i_hlthacc i_condeasy i_havecondom i_condomprice i_cl7day
					   i_tr7day i_earn7day 
					   hlthacc condeasy havecondom condomprice cl7day
					   tr7day hr7day earn7day  closing";
	};
	
	else if "`coeff'" == "i_earn7day" {;
	
	global controls = "i_hlthacc i_condeasy i_havecondom i_condomprice i_cl7day
					   i_tr7day i_hr7day
					   hlthacc condeasy havecondom condomprice cl7day
					   tr7day hr7day earn7day  closing";
	};

disp "**********`out'**********";
global var = "`out'";
global coeff2 = "`coeff'";
do "$db/Crimes-Against-Morality_Bootstrap_5-2.do";


};
*;
};

*5.3 Bootstrapping Table I.IX, Column 3;

do "$db/Crimes-Against-Morality_Bootstrap_5-3.do";

log close;

